package com.youlu.campus.entity.enums;

public enum CourseVideoEnum {
    NOT_START("未开始", 0),
    STUDYING("学习中", 1),
    COMPLETE("已完成", 2),
    ;
    // 成员变量
    private final String name;
    private final int type;

    // 构造方法
    CourseVideoEnum(String name, int type) {
        this.name = name;
        this.type = type;
    }

    // 普通方法
    public static String getName(int type) {
        for (CourseVideoEnum c : CourseVideoEnum.values()) {
            if (c.getType() == type) {
                return c.name;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public int getType() {
        return type;
    }
}
